package com.pl;


import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author shent
 */
public class TestRun {
    public static void main(String[] args) {
        User user = new User();
        user.setName("name");
        user.setEmail("email");
        User user1 = new User();
        user1.setName("name1");
        user1.setEmail("email1");
        List<User> userList = new ArrayList<>();
        userList.add(user);
        userList.add(user1);

        List<UserDto> dto = userList.stream().map(UserDto::new).collect(Collectors.toList());
        dto.forEach(System.out::println);

    }
}
